home *** CD-ROM | disk | FTP | other *** search
-
- ******************************************************************************
- * *
- * HodgePodge: An example Apple IIGS Desktop application *
- * *
- * Written in 65816 Assembler by the Apple IIGS Tools Team *
- * Modified by Ben Koning for "Programmer's Introduction to the Apple IIGS" *
- * *
- * Copyright (c) 1986-87 by Apple Computer, Inc. *
- * *
- * ---------------------------------------------------------------------- *
- * *
- * ASM65816 Code file "PRINT.ASM" -- Print dialogs; Print Manager calls *
- * *
- ******************************************************************************
-
-
-
- ****************************************************************
- *
- * DoChooserItem
- *
- * This is the routine that handles the Choose Printer
- * menu item.
- *
- ****************************************************************
- DoChooserItem START
- using GlobalData
-
- PushWord #0
- _PrChooser
- pla
-
- rts
-
- END
-
-
-
- ****************************************************************
- *
- * DoSetupItem
- *
- * This is the routine that handles the page setup item.
- *
- ****************************************************************
- DoSetupItem START
- using GlobalData
-
- lda PrintRecord
- ora PrintRecord+2
- bne AlreadyThere
-
- jsr SetupDefault
-
- AlreadyThere anop
- pha
- PushLong PrintRecord
- _PrValidate
- pla
- Pushword #0
- Pushlong PrintRecord
- _prStlDialog
- pla
-
- rts
-
- END
-
-
- ****************************************************************
- *
- * SetupDefault
- *
- * This routine creates the default PrintRecord. Puts handle
- * in PrintRecord.
- *
- ****************************************************************
- SetupDefault START
- using GlobalDATA
-
- PushLong #0
- PushLong #140
- Pushword MyID
- PushWord #$8010
- PushLong #0
- _newHandle
- pla
- sta PrintRecord
- pla
- sta PrintRecord+2
-
- AlreadyThere anop
- PushLong PrintRecord
- _prdefault
-
- rts
-
-
- END
-
- ****************************************************************
- *
- * DoPrintItem
- *
- * This is the routine that handles the print item in the
- * file menu.
- *
- ****************************************************************
- DoPrintItem START
- using GlobalData
-
- pha ; get the current port
- pha
- _GetPort
-
- pha ; first see if there is a window
- pha ; to print.
- _FrontWindow ; and save pointer to it now
- pla ; before any dialogs are displayed!
- sta WindowToPrint
- pla
- sta WindowToPrint+2
-
- ora WindowToPrint
- bne SomethingToPrint
- brl SkipIt
-
- SomethingToPrint anop
- lda PrintRecord
- ora PrintRecord+2
- bne AlreadySet
-
- jsr SetupDefault
-
- AlreadySet anop
- PushLong PrintRecord
- _PrValidate
-
-
- PushWord #0
- PushLong PrintRecord
- _PrJobDialog
- pla
-
- bne continue
- brl skipit
-
- continue anop
-
- _WaitCursor
-
- PushLong #0
- PushLong PrintRecord
- PushLong #0
- _PrOpenDoc
- pla
- sta PrintPort
- pla
- sta PrintPort+2
-
- PushLong PrintPort
- PushLong #0
- _PrOpenPage
-
- jsr DrawTopWindow
-
- PushLong PrintPort
- _PrClosePage
-
- PushLong PrintPort
- _PrCloseDoc
-
- PushLong PrintRecord
- PushLong #0
- PushLong #0
- _PrPicFile
-
- _InitCursor
-
- SkipIt anop
-
- _SetPort ; restore original port
-
- rts
-
- END
-
-
- ****************************************************************
- *
- * DrawTopWindow
- *
- *
- *
- ****************************************************************
- DrawTopWindow START
- using GlobalDATA
-
- pha ; space for result of GetWRefCon call
- pha
- PushLong WindowToPrint
- _GetWRefCon
-
- pla
- sta TheRefCon
- plx
- stx TheRefCon+2
- jsr Deref
- sta 0
- stx 2
- ldy #oFlag
- lda [0],y
- beq UsePaint
-
-
- ldy #oFontID+2
- lda [0],y
- tax
- dey
- dey
- lda [0],y
- jsl ShowFont
-
- bra AllDone
-
- UsePaint anop
- ldy #oHandle+2 ; get handle to pic data
- lda [0],y
- tax
- dey
- dey
- lda [0],y
- jsl PaintIt
-
-
- AllDone lda TheRefCon
- ldx TheRefCon+2
- jsr Unlock
-
- rts
-
-
- theRefCon ds 4
-
- WindowToPrint ENTRY
- ds 4
-
-
- END
-